<template>
  <div class="order-goods-num" :class="{'order-goods-num-check':flag}" @click="chooseItem">
    <img :src="goods.image" alt="" width="20" height="20" style="border: 1px solid #cccccc">
    <span>{{goods.orderNum}}</span>
  </div>
</template>

<script>
export default {
  name: "OrderGoodsNum",
  props:{
    goods:{
      required: true,
      type: Object,
    }
  },
  data(){
    return {
      flag: false,
    }
  },
  methods:{
    chooseItem(){
      this.flag = !this.flag
      this.$emit('click',this.goods,this.flag)
    }
  }
}
</script>

<style scoped lang="scss">
.order-goods-num{
  display: inline-block;
  border: 1px solid #cccccc;
  border-radius: 5px;
  padding: 3px 10px;
  text-align: center;
  vertical-align: top;
  color: #AAAAAA;
  height: 35px;
  margin-right: 10px;
  cursor: pointer;
  //line-height: 30px;

  img{
    width: 25px;
    height: 25px;
    margin-right: 10px;
  }
  span{
    vertical-align: super;
  }
}
.order-goods-num-check{
  border-color: #3894ff;
  background-color: rgba(233, 243, 255, 1);
  color: #3894FF;
}

</style>
